package com.design.patterns.list.singleton;

/**
 * 单例模式：饿汉式二，静态代码块。
 * @author Wangzhiwen
 */
public class SingletonB {

    public static void main(String[] args) {
        Singleton1 instance = Singleton1.getInstance();
    }

}

class Singleton1{


    private Singleton1(){

    }

    private static final Singleton1 SINGLETON;

    static {
        SINGLETON = new Singleton1();
    }

    public static Singleton1 getInstance(){
        return SINGLETON;
    }

}
